#ifndef CALCULATEINDICES_H
#define CALCULATEINDICES_H
#include <QObject>

#include <cstdlib>
#include <stdio.h>

#include "pid.h"


class calculateIndices:public QObject
{
Q_OBJECT
private:
    calculateIndices();
    ~calculateIndices();
    static calculateIndices* instance;
    double intCont;
    int K;

    //To Plot
    QVector<double> ISEPoints;
    QVector<double> IAEPoints;
    QVector<double> ITAEPoints;
    QVector<double> ITSEPoints;
    QVector<double> VYPoints;
    QVector<double> VSCPoints;
    QVector<double> TimePoints;

    bool running;
    double tempIndices;

public:
    static calculateIndices *getInstance();
    QwtPlotCurve ISECurve;
    QwtPlotCurve IAECurve;
    QwtPlotCurve ITAECurve;
    QwtPlotCurve ITSECurve;
    QwtPlotCurve VYCurve;
    QwtPlotCurve VSCCurve;
    double ISE;
    double IAE;
    double ITAE;
    double ITSE;
    double intY;
    double desvioY;
    double desvioControl;
    double yVariance;
    double controlVariance;


public slots:
    void calcStep();
    void setTime(int);


signals:
    void endCalculate();
};


#endif // CALCULATEINDICES_H
